home *** CD-ROM | disk | FTP | other *** search
/ Aminet 50 / Aminet 50 (2002)(GTI - Schatztruhe)[!][Aug 2002].iso / Aminet / text / edit / tecoc-146.lha / exev.c < prev    next >
C/C++ Source or Header  |  1991-07-05  |  1KB  |  50 lines

  1. /*****************************************************************************
  2.  
  3.     ExeV()
  4.  
  5.     This function executes a V command.  The V command is for "viewing"
  6. some lines around the cursor.
  7.  
  8.     nV    do 1-nTnT
  9.     m,nV    do 1-mTnT
  10.  
  11. *****************************************************************************/
  12.  
  13. #include "zport.h"        /* define portability identifiers */
  14. #include "tecoc.h"        /* define general identifiers */
  15. #include "defext.h"        /* define external global variables */
  16.  
  17. DEFAULT ExeV()            /* execute an V command */
  18. {
  19.     LONG firstarg;
  20.  
  21.     DBGFEN(1,"ExeV",NULL);
  22.     if (EStTop == EStBot) {            /* if no numeric argument */
  23.         NArgmt = 1;            /* default is 1V */
  24.     } else {
  25.         UMinus();            /* if it's -V, make it -1V */
  26.         if (GetNmA() == FAILURE) {    /* get numeric argument */
  27.             DBGFEX(1,DbgFNm,"FAILURE");
  28.             return FAILURE;
  29.         }
  30.     }
  31.  
  32.     firstarg = 1 - ((CmdMod & MARGIS) ? MArgmt : NArgmt);
  33.     if (firstarg <= 0) {
  34.         TypBuf(GapBeg+Ln2Chr(firstarg), GapBeg);
  35.     } else {
  36.         TypBuf(GapEnd+1, GapEnd+Ln2Chr(firstarg)+1);
  37.     }
  38.  
  39.     if (NArgmt <= 0) {
  40.         TypBuf(GapBeg+Ln2Chr(NArgmt), GapBeg);
  41.     } else {
  42.         TypBuf(GapEnd+1, GapEnd+Ln2Chr(NArgmt)+1);
  43.     }
  44.  
  45.     CmdMod = '\0';                /* clear modifiers flags */
  46.  
  47.     DBGFEX(1,DbgFNm,"SUCCESS");
  48.     return SUCCESS;
  49. }
  50.